
#include "qpixmapitem.h"

Qpixmapitem::Qpixmapitem()
{

}
Qpixmapitem::Qpixmapitem(const QString & fileName,QGraphicsScene*scene)
{
    pixmap.load(fileName);
    scene->addItem(this);
}


QRectF Qpixmapitem:: boundingRect ()const
{
    return QRectF(-pixmap.width()/2,-pixmap.height(),pixmap.width(),pixmap.height());
}


void Qpixmapitem::paint(QPainter*painter,const QStyleOptionGraphicsItem* option,QWidget* widget)
{
    painter->drawPixmap(-pixmap.width()/2,-pixmap.height(),pixmap);
}
